Skip to content

fix(groups): use the documented membership query - #1161

Merged
steipete merged 1 commit into
mainfrom
codex/fix-groups-query-1059-20260924
Sep 24, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-groups-query-1059-20260924

Conversation

@steipete

Copy link
Copy Markdown
Collaborator

groups list and Groups backups currently send a parenthesized OR between discussion-forum and dynamic labels. The reporter demonstrated that Cloud Identity rejects that query with HTTP 400 while accepting Google's documented single-discussion-forum predicate.

Use that documented predicate for both callers, preserve native pagination and output, and escape existing backslashes before apostrophes in the member literal. Google documents this filter for all direct and indirect memberships except identity-mapped groups; its dynamic-group creation example uses the same label. No second query, deduplication, or custom cursor is needed. Update the Workspace guide and Unreleased changelog; thanks @hengshan for the comparative API report.

Fixes #1059.

Validation:

  • Regression tests fail on the original implementation and pass with the fix. Generated-client HTTP tests exercise first-page, explicit cursor, all-page, and all-from-cursor calls with pageSize=1 and opaque tokens. Backup tests verify the same query, pageSize=1000, native continuation, and sorted results.
  • Exact query tests cover trimming, case preservation, apostrophes, and combined backslash/apostrophe escaping.
  • The configured Workspace accounts were probed and both returned auth-required because no delegated Groups credential exists. User OAuth is healthy; reauthentication cannot provide that missing delegation. Independent live OR rejection and dynamic-membership retrieval were not performed.

Maintainer decision: accept the documented API contract plus request-level regression proof for this bounded repair, relaxing the earlier live-provider gate. No new permissions or account configuration were introduced.

Contract references: membership query, group labels, security groups, and dynamic groups.

Full local make ci passed; the final documentation wording also passed make docs-check. Independent P2 Auto Review completed with no actionable findings after the documentation was narrowed to the method-specific contract.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 1:17 PM ET / 17:17 UTC.

ClawSweeper review

What this changes

The branch changes the shared membership query used by groups list and Groups backups, adds query and pagination regression tests, and updates the Workspace guide and changelog.

Merge readiness

✅ Ready for maintainer review

Keep this PR open for landing. Current main and v0.41.0 still contain the reported Cloud Identity query, and the proposed repair follows Google's documented method and the maintainer's accepted validation boundary.

Priority: P2
Reviewed head: 7d057e04c2459d3cd891bcee1825a77843be62e6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with substantial request-level coverage, documentation, and an explicit maintainer decision on the live-provider evidence gap.
Proof confidence 🌊 off-meta tidepool Not applicable: The collaborator-authored PR is exempt from the ordinary contributor proof gate. The reporter observed the old provider failure; generated-client HTTP tests exercise the changed listing and backup requests after the fix, while no eligible live provider run was available. The maintainer explicitly accepted that validation boundary. Backup contents may change as the query is repaired, but the stored snapshot format does not change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The collaborator-authored PR is exempt from the ordinary contributor proof gate. The reporter observed the old provider failure; generated-client HTTP tests exercise the changed listing and backup requests after the fix, while no eligible live provider run was available. The maintainer explicitly accepted that validation boundary. Backup contents may change as the query is repaired, but the stored snapshot format does not change.
Evidence reviewed 8 items Current main remains affected: The main-branch query still combines discussion-forum and dynamic labels with OR; both listing and backup call this shared helper.
Latest release remains affected: The v0.41.0 source contains the same OR query.
Proposed query: The branch uses the documented single-label predicate and escapes existing backslashes before apostrophes.
Findings None None.
Security None None.

How this fits together

The Groups CLI and backup collector use the same Cloud Identity membership query for a Workspace account. Cloud Identity returns paginated memberships that become command output or backup snapshot contents.

flowchart LR
 A[Workspace account] --> B[Groups listing or backup]
 B --> C[Shared membership query]
 C --> D[Cloud Identity search]
 D --> E[Paginated memberships]
 E --> F[CLI output or backup snapshot]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Code and test delta production +4/-4 lines; tests +143/-16 lines The production change is narrow and has focused request, pagination, backup, and escaping coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #1059
Summary: This PR is the candidate repair for the linked, still-open Groups query report.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep one documented Cloud Identity query path for both consumers, preserve provider-issued cursors, and close the linked issue after the repair merges.

Do we have a high-confidence way to reproduce the issue?

Yes for the request construction: current main sends the reported OR query, and the reporter supplied a comparative API result. This review did not independently repeat the call with an eligible Cloud Identity credential.

Is this the best way to solve the issue?

Yes. Changing the shared query helper matches Google's documented membership search and retains the existing pagination path without introducing a second request or cursor format.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against c24b7dc152f0.

Labels

Label changes:

  • add P2: This repairs a reported failure in a service-specific Groups workflow with limited blast radius.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The collaborator-authored PR is exempt from the ordinary contributor proof gate. The reporter observed the old provider failure; generated-client HTTP tests exercise the changed listing and backup requests after the fix, while no eligible live provider run was available. The maintainer explicitly accepted that validation boundary. Backup contents may change as the query is repaired, but the stored snapshot format does not change.

Label justifications:

  • P2: This repairs a reported failure in a service-specific Groups workflow with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The collaborator-authored PR is exempt from the ordinary contributor proof gate. The reporter observed the old provider failure; generated-client HTTP tests exercise the changed listing and backup requests after the fix, while no eligible live provider run was available. The maintainer explicitly accepted that validation boundary. Backup contents may change as the query is repaired, but the stored snapshot format does not change.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • salmonumbrella: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 1e4bb86 into main Sep 24, 2026
15 checks passed
@steipete

Copy link
Copy Markdown
Collaborator Author

Landed as 1e4bb86, fixing #1059 for group listings and backups. The merged tree exactly matches reviewed/tested head 7d057e0.

Validation: the new generated-client regressions fail on the original OR query and pass with Google's documented predicate; exact queries, literal escaping, pageSize=1 listings, opaque --page/--all continuation, and pageSize=1000 backup collection are covered. Full local make ci, final docs checks, independent P2 review, hosted CI run 36032523220 (Linux, Windows, macOS build, minimum Go, worker), Docker run 36032523377, and CodeQL passed. ClawSweeper found no actionable findings.

Live-provider limitation remains explicit: both configured Workspace identities lacked delegated Groups credentials, so the original OR failure and real dynamic-group inclusion were not independently repeated. The accepted proof is the reporter's comparison, Google's method-specific contract, and request-level regressions. The maintainer relaxed the prior live gate for this bounded repair; no grants, IAM, billing, APIs, or group fixtures were changed.

@steipete
steipete deleted the codex/fix-groups-query-1059-20260924 branch September 24, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

groups list 400 INVALID_ARGUMENT: searchTransitiveGroups rejects (A || B) OR label filter

1 participant